import request from "/common/api.js";

/**
 * 获取用户信息
 * @param {Object} callback 回调对象，包含 success 和 fail 函数
 */
export const getUserInfo = (callback = {}) => {
  return request.loadPostData("/user/info", {}, callback);
};

/**
 * 获取推荐服务列表
 * @param {Object} callback 回调对象，包含 success 和 fail 函数
 */
export const getRecommendServices = (callback = {}) => {
  return request.loadPostData("/recommend/services", {}, callback);
};

/**
 * 获取菜单列表
 * @param {Object} params 请求参数
 * @param {Object} callback 回调对象，包含 success 和 fail 函数
 */
export const getMenuList = (params = {}, callback = {}) => {
  return request.loadPostData("/appMenu/list", params, callback);
};

/**
 * 默认推荐服务数据
 */
export const defaultRecommendServices = [
  {
    name: '限时特惠',
    icon: 'special',
    url: '/pages/special/index'
  },
  {
    name: '生活服务',
    icon: 'service',
    url: '/pages/service/index'
  },
  {
    name: '附近门店',
    icon: 'nearby',
    url: '/pages/store/nearby'
  },
  {
    name: '优惠券',
    icon: 'coupon',
    url: '/pages/user/coupon'
  },
  {
    name: '充值中心',
    icon: 'recharge',
    url: '/pages/user/recharge'
  },
  {
    name: '会员专区',
    icon: 'membership',
    url: '/pages/user/membership'
  }
];
